<?php

/*
|--------------------------------------------------------------------------
| Web Routes
|--------------------------------------------------------------------------
|
| Here is where you can register web routes for your application. These
| routes are loaded by the RouteServiceProvider within a group which
| contains the "web" middleware group. Now create something great!
|
*/

Auth::routes();
Route::redirect('/', '/product');
// 商品首页
Route::get('product', 'ProductController@index')->name('product.index');
// 商品详情
Route::get('product/{product}', 'ProductController@show')->name('product.show');
// 结束竞拍 (由于本软件基于windows, 无法使用linux的corn定时任务)
Route::get('finish/bidding', 'ProductController@finishBidding');

// 登录后拥有的权限
Route::group(['middleware' => ['auth', 'verified']], function () {
    // 商品拍卖
    Route::post('product/{product}/bidding', 'ProductController@bidding')->name('product.bidding');
    // 获取竞拍信息
    Route::post('product/{product}/get-bidding/id', 'ProductController@getBiddingListByBiddingId')->name('product.get_bidding_list_by_bidding_id');
});

